using System;
using System.Collections.Generic;
using System.Text;
using BusinessObjects.BO_Actions;
using Entity.StoreProcedure;
using BusinessObjects;
using System.Data;
namespace BusinessObjects.BO_GetObjects {
    public static class BO_portal_modules {
        public static DataTable SelectAll(int status) {
            try {
                usp_portal_modules_select_all entity = new usp_portal_modules_select_all();
                entity.STATUS = status;
                return BO_Actions<usp_portal_modules_select_all>.ExecuteAndReturnDataTable(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static DataTable SelectTop(int rows, int status) {
            try {
                usp_portal_modules_select_top entity = new usp_portal_modules_select_top();
                entity.NUMBERRECORD = rows;
                entity.STATUS = status;
                return BO_Actions<usp_portal_modules_select_top>.ExecuteAndReturnDataTable(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static DataTable Search(int module_id) {
            try {
                usp_portal_modules_search entity = new usp_portal_modules_search();
                entity.MODULE_ID = module_id;

                return BO_Actions<usp_portal_modules_search>.ExecuteAndReturnDataTable(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static DataTable SelectWithPaged(int startIndex, int pageCount, int status) {
            try {
                usp_portal_modules_select_paged entity = new usp_portal_modules_select_paged();
                entity.STARTINDEX = startIndex;
                entity.MAXRECORDS = pageCount;
                entity.STATUS = status;
                return BO_Actions<usp_portal_modules_select_paged>.ExecuteAndReturnDataTable(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static string Insert(int module_type_id, string category_id, string full_name, string thumb_image, string read_more_link, int page_size, bool is_display_on_detail, bool is_display_on_home_page, int order_display, DateTime created_date, string created_by, DateTime modify_date, string modify_by, int status) {
            try {
                usp_portal_modules_insert entity = new usp_portal_modules_insert();
                entity.MODULE_TYPE_ID = module_type_id;
                entity.CATEGORY_ID = category_id;
                entity.FULL_NAME = full_name;
                entity.THUMB_IMAGE = thumb_image;
                entity.READ_MORE_LINK = read_more_link;
                entity.PAGE_SIZE = page_size;
                entity.IS_DISPLAY_ON_DETAIL = is_display_on_detail;
                entity.IS_DISPLAY_ON_HOME_PAGE = is_display_on_home_page;
                entity.ORDER_DISPLAY = order_display;
                entity.CREATED_DATE = created_date;
                entity.CREATED_BY = created_by;
                entity.MODIFY_DATE = modify_date;
                entity.MODIFY_BY = modify_by;
                entity.STATUS = status;

                return BO_Actions<usp_portal_modules_insert>.ExecuteAndReturnStringValue(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static string Update(int module_id, int module_type_id, string category_id, string full_name, string thumb_image, string read_more_link, int page_size, bool is_display_on_detail, bool is_display_on_home_page, int order_display, DateTime created_date, string created_by, DateTime modify_date, string modify_by, int status) {
            try {
                usp_portal_modules_update entity = new usp_portal_modules_update();
                entity.MODULE_ID = module_id;
                entity.MODULE_TYPE_ID = module_type_id;
                entity.CATEGORY_ID = category_id;
                entity.FULL_NAME = full_name;
                entity.THUMB_IMAGE = thumb_image;
                entity.READ_MORE_LINK = read_more_link;
                entity.PAGE_SIZE = page_size;
                entity.IS_DISPLAY_ON_DETAIL = is_display_on_detail;
                entity.IS_DISPLAY_ON_HOME_PAGE = is_display_on_home_page;
                entity.ORDER_DISPLAY = order_display;
                entity.CREATED_DATE = created_date;
                entity.CREATED_BY = created_by;
                entity.MODIFY_DATE = modify_date;
                entity.MODIFY_BY = modify_by;
                entity.STATUS = status;

                return BO_Actions<usp_portal_modules_update>.ExecuteAndReturnStringValue(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static bool Delete(string ids, string spliter, int delete_type) {
            try {
                usp_portal_modules_delete entity = new usp_portal_modules_delete();
                entity.IDS = ids;
                entity.SPLITER = spliter;
                entity.DELETE_TYPE = delete_type;

                return BO_Actions<usp_portal_modules_delete>.ExecuteAndReturnBooleanValue(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static bool Restore(int module_id) {
            try {
                usp_portal_modules_restore entity = new usp_portal_modules_restore();
                entity.MODULE_ID = module_id;

                return BO_Actions<usp_portal_modules_restore>.ExecuteAndReturnBooleanValue(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static DataTable SelectAdmin(int category_id, int location_id, string keywords) {
            try {
                usp_portal_modules_select_admin entity = new usp_portal_modules_select_admin();
                entity.CATEGORY_ID = category_id;
                entity.LOCATION_ID = location_id;
                entity.KEYWORDS = keywords;
                return BO_Actions<usp_portal_modules_select_admin>.ExecuteAndReturnDataTable(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static DataTable SelectContent(string content_key, int option) {
            try {
                usp_portal_modules_select_content entity = new usp_portal_modules_select_content();
                entity.CONTENT_KEY = content_key;
                entity.OPTION = option;
                return BO_Actions<usp_portal_modules_select_content>.ExecuteAndReturnDataTable(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static bool Order(string STRING, int location, int category_id) {
            try {
                usp_portal_modules_order entity = new usp_portal_modules_order();
                entity.STRING = STRING;
                entity.LOCATION_ID = location;
                entity.CATEGORY_ID = category_id;
                return BO_Actions<usp_portal_modules_order>.ExecuteAndReturnBooleanValue(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static DataTable SelectHome(int category_id, int location_id) {
            try {
                usp_portal_modules_select_home entity = new usp_portal_modules_select_home();
                entity.CATEGORY_ID = category_id;
                entity.LOCATION_ID = location_id;
                return BO_Actions<usp_portal_modules_select_home>.ExecuteAndReturnDataTable(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
    }
}

